﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace blackhouse.BlackApart.Business.Prices {
    internal class PriceProfileDateModification : PriceProfileModification {

        #region Fields

        private int rangeToStartReservationFrom;
        private int rangeToStartReservationTo;

        #endregion

        #region Constructors

        public PriceProfileDateModification(int rangeToStartReservationFrom, int rangeToStartReservationTo, PriceProfileModificationType modType, double modValue)
            : base(modType, modValue) {
            this.rangeToStartReservationFrom = rangeToStartReservationFrom;
            this.rangeToStartReservationTo = rangeToStartReservationTo;
        }

        #endregion

        #region Methods

        public override bool IsApply(DateTime reservationFrom, DateTime reservationTo, int numberOfPeoples) {
            int v = Convert.ToInt32(( reservationFrom.Date - DateTime.Now.Date ).TotalDays);
            return
                v >= rangeToStartReservationFrom
                && v <= rangeToStartReservationTo;
        }

        #endregion

    }
}
